<template>
    <div>
        <div class="i-layout-page-header">
            <PageHeader title="基本信息" hidden-breadcrumb />
        </div>
        <Card :bordered="false" dis-hover class="ivu-mt i-table-no-border">
             <DescriptionList title="基本信息" :col="1">
                 <Description term="姓名：">{{data.users[0].nickName}}</Description>
                 <Description term="申请人电话：">{{data.users[0].phonenumber}}</Description>
                 <Description term="报销金额：">{{data.reimCount}}</Description>
                 <Description term="报销类别：">
                     <span v-if="data.reimType === '1'">差旅费</span>
                     <span v-if="data.reimType === '2'">交通费</span>
                     <span v-if="data.reimType === '3'">办公用品</span>
                     <span v-if="data.reimType === '4'">运输费</span>
                 </Description>
                 <Description term="报销理由（明细）：">{{data.reimReson}}</Description>
                 <Description term="申请时间：">{{data.addTime}}</Description>
             </DescriptionList>
        </Card>
    </div>
</template>
<script>
    import reimbursement from "@/api/finance-reimbursement";
    export default {
        data () {
            return {
                data:''
            }
        },
        created() {
            this.getDtail();
        },
        methods:{
            // T和Z时间转换
            changeDate(oldDate) {
                var dateee = new Date(oldDate).toJSON();//这个ie不兼容，会返回1970年的时间
                var date = new Date(+new Date(dateee) + 8 * 3600 * 1000)
                    .toISOString()
                    .replace(/T/g, " ")
                    .replace(/\.[\d]{3}Z/, "");
                return date;
            },
            getDtail(){
                reimbursement.getInfoById({
                    reimId:this.$route.query.reimId
                })
                    .then(res => {
                        // 返回数据
                        this.data = res;
                    })
                    .catch(err => {
                        // 异常情况
                    })
            }
        }
    }
</script>
